﻿@page "{id:int?}"


@model WebAppRazor.Pages.Employees.Edit

@{
    Layout = null;
}

<h3>Edit Employees</h3>

Employee Id : @Model.Id



@if (Model is not null && Model.InputModel is not null && Model.InputModel.ErrorMessages is not null)
{
    <ul style="color: red;">
        @foreach (var errorMessage in Model.InputModel.ErrorMessages)
        {
            <li>@errorMessage</li>
        }
    </ul>
}

<br />

<form method="post" action="/employees/edit/@Model.Id?handler=save">
    @Html.AntiForgeryToken()
    <input type="hidden" name="id" value="@Model.Id" />
    
    <button type="submit">Submit</button>
    
    
</form>

<br />
<form method="post" action="/employees/edit/@Model.Id?handler=delete">
    @Html.AntiForgeryToken()

    <button type="submit">Delete</button>
</form>